
<div class="content-box"><!-- Start Content Box -->
   
    <div class="content-box-header">
        
        <h3>Liên hệ</h3>
        
        <ul class="content-box-tabs">
       
            <li><a href="#tab1" class="default-tab">Table</a></li> <!-- href must be unique and match the id of target div -->
            <li><a href="#tab2">Forms</a></li>
        </ul>
        
        <div class="clear"></div>
        
    </div> <!-- End .content-box-header -->
    
    <div class="content-box-content">
   
        <div class="tab-content default-tab" id="tab1">
	
        	<table id="stock-table" class="table table-bordered">
                <tbody><tr bgcolor="#9fe1e1" id="sort-row" data-base-url="" class="">
                    <th>#</th>
                    <th data-model="Stock" id="stock_modified"><a href="/admin_vina/stock/all/sort:Stock.stock_modified/direction:asc">Tên khách hàng</a></th>
                    <th data-model="Stock" id="stock_name"><a href="">Địa chỉ email</a></th>
                    <th data-model="Stock" id="stock_name"><a href="">Địa chỉ liên hệ</a></th>
                    <th data-model="Stock" id="stock_name"><a href="">Số điện thoại</a></th>
                    <th data-model="Stock" id="stock_name" style="width:500px"><a href="">Nội dung liên hệ</a></th>
                    <th data-model="Stock" id="stock_name"><a href="">Trạng thái</a></th>
                    <th>!</th>
                </tr>
                <?php
                $sql5=mysql_query("SELECT * FROM `tbl_lienhe`");
				$stt=0;
				while($row5=mysql_fetch_array($sql5))
				{
					
					$stt++;
				?>
                    <tr class="error" <?php if(($stt%2)==1){echo 'bgcolor="#f2f1f1"';}else{echo 'bgcolor="#fce3f0"';}?>>
                        <th valign="middle"><?php echo $stt;?></th>
                        <th valign="middle"><?php echo $row5['tenlienhe'];?></th>
                        <th valign="middle"><?php echo $row5['emaillienhe'];?></th>
                        <th valign="middle"><?php echo $row5['diachilienhe'];?></th>
                        <th valign="middle"><?php echo $row5['sdtlienhe'];?></th>
                        <th  style="width:500px"><?php echo $row5['noidunglienhe'];?></th>
                        <th valign="middle"><?php if($row5['trangthai']==0){echo 'Chưa phản hồi';}else{echo 'Đã gửi email phản hồi';};?></th>
                        <th>
                                                <a href="index.php?page=contact&act=mail&edit=<?php echo $row5['id'];?>" class="edit" title="Gửi email"><img style="width:20px" src="../images/email.png"></a>                   
                            <a href="index.php?page=contact&del=<?php echo $row5['id'];?>" class="del" title="Xóa"><img src="../images/del.png" width="15px" /></a>                                    </th>
                    </tr>
               <?php
				}
			   ?>
                    </tbody>
              </table>
        </div> <!-- End #tab1 -->
    </div> <!-- End .content-box-content -->
</div> <!-- End .content-box -->
    <?php

if(isset($_GET['del']))
{
?>
    <div class="del">
		<?php
        $sql6=mysql_query("DELETE FROM `tbl_lienhe` WHERE `id`='".$_GET['del']."'");
		if(isset($sql6))
		{
			?>
			<script>alert('Xóa thành công ! ');</script>
            <?php
			header("refresh:1; index.php?page=contact");
		}else{
			?>
			<script>alert('Xóa thất bại ! ');</script>
            <?php
		}
		?>    	
    </div>
 <?php
}
 ?>
